package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpQoslevelMapper;
import com.ruoyi.net.domain.ElementBusiSrtpQoslevel;
import com.ruoyi.net.service.IElementBusiSrtpQoslevelService;

/**
 * 网元-业务-srtp-qos上下话优先级Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpQoslevelServiceImpl implements IElementBusiSrtpQoslevelService 
{
    @Autowired
    private ElementBusiSrtpQoslevelMapper elementBusiSrtpQoslevelMapper;

    /**
     * 查询网元-业务-srtp-qos上下话优先级
     * 
     * @param id 网元-业务-srtp-qos上下话优先级主键
     * @return 网元-业务-srtp-qos上下话优先级
     */
    @Override
    public ElementBusiSrtpQoslevel selectElementBusiSrtpQoslevelById(String id)
    {
        return elementBusiSrtpQoslevelMapper.selectElementBusiSrtpQoslevelById(id);
    }

    /**
     * 查询网元-业务-srtp-qos上下话优先级列表
     * 
     * @param elementBusiSrtpQoslevel 网元-业务-srtp-qos上下话优先级
     * @return 网元-业务-srtp-qos上下话优先级
     */
    @Override
    public List<ElementBusiSrtpQoslevel> selectElementBusiSrtpQoslevelList(ElementBusiSrtpQoslevel elementBusiSrtpQoslevel)
    {
        return elementBusiSrtpQoslevelMapper.selectElementBusiSrtpQoslevelList(elementBusiSrtpQoslevel);
    }

    /**
     * 新增网元-业务-srtp-qos上下话优先级
     * 
     * @param elementBusiSrtpQoslevel 网元-业务-srtp-qos上下话优先级
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpQoslevel(ElementBusiSrtpQoslevel elementBusiSrtpQoslevel)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpQoslevel.getId())) {
            elementBusiSrtpQoslevel.setId(uuid);
        }
        elementBusiSrtpQoslevel.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslevel.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpQoslevel.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslevel.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpQoslevelMapper.insertElementBusiSrtpQoslevel(elementBusiSrtpQoslevel);
    }

    /**
     * 修改网元-业务-srtp-qos上下话优先级
     * 
     * @param elementBusiSrtpQoslevel 网元-业务-srtp-qos上下话优先级
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpQoslevel(ElementBusiSrtpQoslevel elementBusiSrtpQoslevel)
    {
        elementBusiSrtpQoslevel.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslevel.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpQoslevelMapper.updateElementBusiSrtpQoslevel(elementBusiSrtpQoslevel);
    }

    /**
     * 批量删除网元-业务-srtp-qos上下话优先级
     * 
     * @param ids 需要删除的网元-业务-srtp-qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpQoslevelByIds(String[] ids)
    {
        return elementBusiSrtpQoslevelMapper.deleteElementBusiSrtpQoslevelByIds(ids);
    }

    /**
     * 删除网元-业务-srtp-qos上下话优先级信息
     * 
     * @param id 网元-业务-srtp-qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpQoslevelById(String id)
    {
        return elementBusiSrtpQoslevelMapper.deleteElementBusiSrtpQoslevelById(id);
    }
}
